package com.qiqi.Test;


import com.alibaba.fastjson.JSON;
import com.qiqi.mealordersystem.Mapper.SystemUserMapper;
import com.qiqi.mealordersystem.model.SystemUser;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("config/application.xml");
        SystemUserMapper bean = applicationContext.getBean(SystemUserMapper.class);
        SystemUser user = new SystemUser();
        user.setPhone("12345678910");
        System.out.println(user.getUserid());
        SystemUser systemUser = bean.selectSystemUser(user);
        System.out.println(systemUser);
        List<SystemUser> list = new ArrayList<>();
        list.add(systemUser);
        System.out.println(JSON.toJSONString(list));
        Integer integer1 = bean.deleteSystemUser(list);
        System.out.println("删除"+integer1);
        Integer integer = bean.insertSystemUser(systemUser);
        System.out.println("插入"+integer);

    }

}
